/*
 * Copyright (c) 2004-2006 Derelict Developers
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * * Neither the names 'Derelict', 'DerelictGL', nor the names of its contributors
 *   may be used to endorse or promote products derived from this software
 *   without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
module derelict.opengl.extension.arb.vertex_program;

private
{
    import derelict.opengl.gltypes;
    import derelict.opengl.gl;
    import derelict.opengl.extension.loader;
    import std.string;
}

private bool enabled = false;

struct ARBVertexProgram
{
    static bool load(char[] extString)
    {
        if(extString.find("GL_ARB_vertex_program") == -1)
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1dARB, "glVertexAttrib1dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1dvARB, "glVertexAttrib1dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1fARB, "glVertexAttrib1fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1fvARB, "glVertexAttrib1fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1sARB, "glVertexAttrib1sARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib1svARB, "glVertexAttrib1svARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2dARB, "glVertexAttrib2dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2dvARB, "glVertexAttrib2dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2fARB, "glVertexAttrib2fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2fvARB, "glVertexAttrib2fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2sARB, "glVertexAttrib2sARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib2svARB, "glVertexAttrib2svARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3dARB, "glVertexAttrib3dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3dvARB, "glVertexAttrib3dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3fARB, "glVertexAttrib3fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3fvARB, "glVertexAttrib3fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3sARB, "glVertexAttrib3sARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib3svARB, "glVertexAttrib3svARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NbvARB, "glVertexAttrib4NbvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NivARB, "glVertexAttrib4NivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NsvARB, "glVertexAttrib4NsvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NubARB, "glVertexAttrib4NubARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NubvARB, "glVertexAttrib4NubvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NuivARB, "glVertexAttrib4NuivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4NusvARB, "glVertexAttrib4NusvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4bvARB, "glVertexAttrib4bvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4dARB, "glVertexAttrib4dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4dvARB, "glVertexAttrib4dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4fARB, "glVertexAttrib4fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4fvARB, "glVertexAttrib4fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4ivARB, "glVertexAttrib4ivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4sARB, "glVertexAttrib4sARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4svARB, "glVertexAttrib4svARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4ubvARB, "glVertexAttrib4ubvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4uivARB, "glVertexAttrib4uivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttrib4usvARB, "glVertexAttrib4usvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glVertexAttribPointerARB, "glVertexAttribPointerARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glEnableVertexAttribArrayARB, "glEnableVertexAttribArrayARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glDisableVertexAttribArrayARB, "glDisableVertexAttribArrayARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramStringARB, "glProgramStringARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glBindProgramARB, "glBindProgramARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glDeleteProgramsARB, "glDeleteProgramsARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGenProgramsARB, "glGenProgramsARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramEnvParameter4dARB, "glProgramEnvParameter4dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramEnvParameter4dvARB, "glProgramEnvParameter4dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramEnvParameter4fARB, "glProgramEnvParameter4fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramEnvParameter4fvARB, "glProgramEnvParameter4fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramLocalParameter4dARB, "glProgramLocalParameter4dARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramLocalParameter4dvARB, "glProgramLocalParameter4dvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramLocalParameter4fARB, "glProgramLocalParameter4fARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glProgramLocalParameter4fvARB, "glProgramLocalParameter4fvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramEnvParameterdvARB, "glGetProgramEnvParameterdvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramEnvParameterfvARB, "glGetProgramEnvParameterfvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramLocalParameterdvARB, "glGetProgramLocalParameterdvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramLocalParameterfvARB, "glGetProgramLocalParameterfvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramivARB, "glGetProgramivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetProgramStringARB, "glGetProgramStringARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetVertexAttribdvARB, "glGetVertexAttribdvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetVertexAttribfvARB, "glGetVertexAttribfvARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetVertexAttribivARB, "glGetVertexAttribivARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glGetVertexAttribPointervARB, "glGetVertexAttribPointervARB"))
            return false;
        if(!glBindExtFunc(cast(void**)&glIsProgramARB, "glIsProgramARB"))
            return false;

        enabled = true;
        return true;
    }

    static bool isEnabled()
    {
        return enabled;
    }
}

version(DerelictGL_NoExtensionLoaders)
{
}
else
{
    static this()
    {
        DerelictGL.registerExtensionLoader(&ARBVertexProgram.load);
    }
}

const GLenum GL_COLOR_SUM_ARB                           = 0x8458;
const GLenum GL_VERTEX_PROGRAM_ARB                      = 0x8620;
const GLenum GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB         = 0x8622;
const GLenum GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB            = 0x8623;
const GLenum GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB          = 0x8624;
const GLenum GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB            = 0x8625;
const GLenum GL_CURRENT_VERTEX_ATTRIB_ARB               = 0x8626;
const GLenum GL_PROGRAM_LENGTH_ARB                      = 0x8627;
const GLenum GL_PROGRAM_STRING_ARB                      = 0x8628;
const GLenum GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB      = 0x862E;
const GLenum GL_MAX_PROGRAM_MATRICES_ARB                = 0x862F;
const GLenum GL_CURRENT_MATRIX_STACK_DEPTH_ARB          = 0x8640;
const GLenum GL_CURRENT_MATRIX_ARB                      = 0x8641;
const GLenum GL_VERTEX_PROGRAM_POINT_SIZE_ARB           = 0x8642;
const GLenum GL_VERTEX_PROGRAM_TWO_SIDE_ARB             = 0x8643;
const GLenum GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB         = 0x8645;
const GLenum GL_PROGRAM_ERROR_POSITION_ARB              = 0x864B;
const GLenum GL_PROGRAM_BINDING_ARB                     = 0x8677;
const GLenum GL_MAX_VERTEX_ATTRIBS_ARB                  = 0x8869;
const GLenum GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB      = 0x886A;
const GLenum GL_PROGRAM_ERROR_STRING_ARB                = 0x8874;
const GLenum GL_PROGRAM_FORMAT_ASCII_ARB                = 0x8875;
const GLenum GL_PROGRAM_FORMAT_ARB                      = 0x8876;
const GLenum GL_PROGRAM_INSTRUCTIONS_ARB                = 0x88A0;
const GLenum GL_MAX_PROGRAM_INSTRUCTIONS_ARB            = 0x88A1;
const GLenum GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB         = 0x88A2;
const GLenum GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB     = 0x88A3;
const GLenum GL_PROGRAM_TEMPORARIES_ARB                 = 0x88A4;
const GLenum GL_MAX_PROGRAM_TEMPORARIES_ARB             = 0x88A5;
const GLenum GL_PROGRAM_NATIVE_TEMPORARIES_ARB          = 0x88A6;
const GLenum GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB      = 0x88A7;
const GLenum GL_PROGRAM_PARAMETERS_ARB                  = 0x88A8;
const GLenum GL_MAX_PROGRAM_PARAMETERS_ARB              = 0x88A9;
const GLenum GL_PROGRAM_NATIVE_PARAMETERS_ARB           = 0x88AA;
const GLenum GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB       = 0x88AB;
const GLenum GL_PROGRAM_ATTRIBS_ARB                     = 0x88AC;
const GLenum GL_MAX_PROGRAM_ATTRIBS_ARB                 = 0x88AD;
const GLenum GL_PROGRAM_NATIVE_ATTRIBS_ARB              = 0x88AE;
const GLenum GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB          = 0x88AF;
const GLenum GL_PROGRAM_ADDRESS_REGISTERS_ARB           = 0x88B0;
const GLenum GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB       = 0x88B1;
const GLenum GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB    = 0x88B2;
const GLenum GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3;
const GLenum GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB        = 0x88B4;
const GLenum GL_MAX_PROGRAM_ENV_PARAMETERS_ARB          = 0x88B5;
const GLenum GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB         = 0x88B6;
const GLenum GL_TRANSPOSE_CURRENT_MATRIX_ARB            = 0x88B7;
const GLenum GL_MATRIX0_ARB                             = 0x88C0;
const GLenum GL_MATRIX1_ARB                             = 0x88C1;
const GLenum GL_MATRIX2_ARB                             = 0x88C2;
const GLenum GL_MATRIX3_ARB                             = 0x88C3;
const GLenum GL_MATRIX4_ARB                             = 0x88C4;
const GLenum GL_MATRIX5_ARB                             = 0x88C5;
const GLenum GL_MATRIX6_ARB                             = 0x88C6;
const GLenum GL_MATRIX7_ARB                             = 0x88C7;
const GLenum GL_MATRIX8_ARB                             = 0x88C8;
const GLenum GL_MATRIX9_ARB                             = 0x88C9;
const GLenum GL_MATRIX10_ARB                            = 0x88CA;
const GLenum GL_MATRIX11_ARB                            = 0x88CB;
const GLenum GL_MATRIX12_ARB                            = 0x88CC;
const GLenum GL_MATRIX13_ARB                            = 0x88CD;
const GLenum GL_MATRIX14_ARB                            = 0x88CE;
const GLenum GL_MATRIX15_ARB                            = 0x88CF;
const GLenum GL_MATRIX16_ARB                            = 0x88D0;
const GLenum GL_MATRIX17_ARB                            = 0x88D1;
const GLenum GL_MATRIX18_ARB                            = 0x88D2;
const GLenum GL_MATRIX19_ARB                            = 0x88D3;
const GLenum GL_MATRIX20_ARB                            = 0x88D4;
const GLenum GL_MATRIX21_ARB                            = 0x88D5;
const GLenum GL_MATRIX22_ARB                            = 0x88D6;
const GLenum GL_MATRIX23_ARB                            = 0x88D7;
const GLenum GL_MATRIX24_ARB                            = 0x88D8;
const GLenum GL_MATRIX25_ARB                            = 0x88D9;
const GLenum GL_MATRIX26_ARB                            = 0x88DA;
const GLenum GL_MATRIX27_ARB                            = 0x88DB;
const GLenum GL_MATRIX28_ARB                            = 0x88DC;
const GLenum GL_MATRIX29_ARB                            = 0x88DD;
const GLenum GL_MATRIX30_ARB                            = 0x88DE;
const GLenum GL_MATRIX31_ARB                            = 0x88DF;

version(Windows)
    extern(Windows):
else
    extern(C):

typedef void function(GLuint, GLdouble) pfglVertexAttrib1dARB;
typedef void function(GLuint, GLdouble*) pfglVertexAttrib1dvARB;
typedef void function(GLuint, GLfloat) pfglVertexAttrib1fARB;
typedef void function(GLuint, GLfloat*) pfglVertexAttrib1fvARB;
typedef void function(GLuint, GLshort) pfglVertexAttrib1sARB;
typedef void function(GLuint, GLshort*) pfglVertexAttrib1svARB;
pfglVertexAttrib1dARB               glVertexAttrib1dARB;
pfglVertexAttrib1dvARB              glVertexAttrib1dvARB;
pfglVertexAttrib1fARB               glVertexAttrib1fARB;
pfglVertexAttrib1fvARB              glVertexAttrib1fvARB;
pfglVertexAttrib1sARB               glVertexAttrib1sARB;
pfglVertexAttrib1svARB              glVertexAttrib1svARB;

typedef void function(GLuint, GLdouble, GLdouble) pfglVertexAttrib2dARB;
typedef void function(GLuint, GLdouble*) pfglVertexAttrib2dvARB;
typedef void function(GLuint, GLfloat, GLfloat) pfglVertexAttrib2fARB;
typedef void function(GLuint, GLfloat*) pfglVertexAttrib2fvARB;
typedef void function(GLuint, GLshort, GLshort) pfglVertexAttrib2sARB;
typedef void function(GLuint, GLshort*) pfglVertexAttrib2svARB;
pfglVertexAttrib2dARB               glVertexAttrib2dARB;
pfglVertexAttrib2dvARB              glVertexAttrib2dvARB;
pfglVertexAttrib2fARB               glVertexAttrib2fARB;
pfglVertexAttrib2fvARB              glVertexAttrib2fvARB;
pfglVertexAttrib2sARB               glVertexAttrib2sARB;
pfglVertexAttrib2svARB              glVertexAttrib2svARB;


typedef void function(GLuint, GLdouble, GLdouble, GLdouble) pfglVertexAttrib3dARB;
typedef void function(GLuint, GLdouble*) pfglVertexAttrib3dvARB;
typedef void function(GLuint, GLfloat, GLfloat, GLfloat) pfglVertexAttrib3fARB;
typedef void function(GLuint, GLfloat*) pfglVertexAttrib3fvARB;
typedef void function(GLuint, GLshort, GLshort, GLshort) pfglVertexAttrib3sARB;
typedef void function(GLuint, GLshort*) pfglVertexAttrib3svARB;
pfglVertexAttrib3dARB               glVertexAttrib3dARB;
pfglVertexAttrib3dvARB              glVertexAttrib3dvARB;
pfglVertexAttrib3fARB               glVertexAttrib3fARB;
pfglVertexAttrib3fvARB              glVertexAttrib3fvARB;
pfglVertexAttrib3sARB               glVertexAttrib3sARB;
pfglVertexAttrib3svARB              glVertexAttrib3svARB;

typedef void function(GLuint, GLbyte*) pfglVertexAttrib4NbvARB;
typedef void function(GLuint, GLint*) pfglVertexAttrib4NivARB;
typedef void function(GLuint, GLshort*) pfglVertexAttrib4NsvARB;
typedef void function(GLuint, GLubyte, GLubyte, GLubyte, GLubyte) pfglVertexAttrib4NubARB;
typedef void function(GLuint, GLubyte*) pfglVertexAttrib4NubvARB;
typedef void function(GLuint, GLuint*) pfglVertexAttrib4NuivARB;
typedef void function(GLuint, GLushort*) pfglVertexAttrib4NusvARB;
pfglVertexAttrib4NbvARB                 glVertexAttrib4NbvARB;
pfglVertexAttrib4NivARB                 glVertexAttrib4NivARB;
pfglVertexAttrib4NsvARB                 glVertexAttrib4NsvARB;
pfglVertexAttrib4NubARB                 glVertexAttrib4NubARB;
pfglVertexAttrib4NubvARB                glVertexAttrib4NubvARB;
pfglVertexAttrib4NuivARB                glVertexAttrib4NuivARB;
pfglVertexAttrib4NusvARB                glVertexAttrib4NusvARB;

typedef void function(GLuint, GLbyte*) pfglVertexAttrib4bvARB;
typedef void function(GLuint, GLdouble, GLdouble, GLdouble, GLdouble) pfglVertexAttrib4dARB;
typedef void function(GLuint, GLdouble*) pfglVertexAttrib4dvARB;
typedef void function(GLuint, GLfloat, GLfloat, GLfloat, GLfloat) pfglVertexAttrib4fARB;
typedef void function(GLuint, GLfloat*) pfglVertexAttrib4fvARB;
typedef void function(GLuint, GLint*) pfglVertexAttrib4ivARB;
typedef void function(GLuint, GLshort, GLshort, GLshort, GLshort) pfglVertexAttrib4sARB;
typedef void function(GLuint, GLshort*) pfglVertexAttrib4svARB;
typedef void function(GLuint, GLubyte*) pfglVertexAttrib4ubvARB;
typedef void function(GLuint, GLuint*) pfglVertexAttrib4uivARB;
typedef void function(GLuint, GLushort*) pfglVertexAttrib4usvARB;
pfglVertexAttrib4bvARB              glVertexAttrib4bvARB;
pfglVertexAttrib4dARB               glVertexAttrib4dARB;
pfglVertexAttrib4dvARB              glVertexAttrib4dvARB;
pfglVertexAttrib4fARB               glVertexAttrib4fARB;
pfglVertexAttrib4fvARB              glVertexAttrib4fvARB;
pfglVertexAttrib4ivARB              glVertexAttrib4ivARB;
pfglVertexAttrib4sARB               glVertexAttrib4sARB;
pfglVertexAttrib4svARB              glVertexAttrib4svARB;
pfglVertexAttrib4ubvARB             glVertexAttrib4ubvARB;
pfglVertexAttrib4uivARB             glVertexAttrib4uivARB;
pfglVertexAttrib4usvARB             glVertexAttrib4usvARB;

typedef void function(GLuint, GLint, GLenum, GLboolean, GLsizei, GLvoid*) pfglVertexAttribPointerARB;
typedef void function(GLuint) pfglEnableVertexAttribArrayARB;
typedef void function(GLuint) pfglDisableVertexAttribArrayARB;
typedef void function(GLenum, GLenum, GLsizei, GLvoid*) pfglProgramStringARB;
typedef void function(GLenum, GLuint) pfglBindProgramARB;
typedef void function(GLsizei, GLuint*) pfglDeleteProgramsARB;
typedef void function(GLsizei, GLuint*) pfglGenProgramsARB;
pfglVertexAttribPointerARB          glVertexAttribPointerARB;
pfglEnableVertexAttribArrayARB      glEnableVertexAttribArrayARB;
pfglDisableVertexAttribArrayARB     glDisableVertexAttribArrayARB;
pfglProgramStringARB                glProgramStringARB;
pfglBindProgramARB                  glBindProgramARB;
pfglDeleteProgramsARB               glDeleteProgramsARB;
pfglGenProgramsARB                  glGenProgramsARB;

typedef void function(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) pfglProgramEnvParameter4dARB;
typedef void function(GLenum, GLuint, GLdouble*) pfglProgramEnvParameter4dvARB;
typedef void function(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) pfglProgramEnvParameter4fARB;
typedef void function(GLenum, GLuint, GLfloat*) pfglProgramEnvParameter4fvARB;
typedef void function(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble) pfglProgramLocalParameter4dARB;
typedef void function(GLenum, GLuint, GLdouble*) pfglProgramLocalParameter4dvARB;
typedef void function(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat) pfglProgramLocalParameter4fARB;
typedef void function(GLenum, GLuint, GLfloat*) pfglProgramLocalParameter4fvARB;
typedef void function(GLenum, GLuint, GLdouble*) pfglGetProgramEnvParameterdvARB;
typedef void function(GLenum, GLuint, GLfloat*) pfglGetProgramEnvParameterfvARB;
typedef void function(GLenum, GLuint, GLdouble*) pfglGetProgramLocalParameterdvARB;
typedef void function(GLenum, GLuint, GLfloat*) pfglGetProgramLocalParameterfvARB;
pfglProgramEnvParameter4dARB        glProgramEnvParameter4dARB;
pfglProgramEnvParameter4dvARB       glProgramEnvParameter4dvARB;
pfglProgramEnvParameter4fARB        glProgramEnvParameter4fARB;
pfglProgramEnvParameter4fvARB       glProgramEnvParameter4fvARB;
pfglProgramLocalParameter4dARB      glProgramLocalParameter4dARB;
pfglProgramLocalParameter4dvARB     glProgramLocalParameter4dvARB;
pfglProgramLocalParameter4fARB      glProgramLocalParameter4fARB;
pfglProgramLocalParameter4fvARB     glProgramLocalParameter4fvARB;
pfglGetProgramEnvParameterdvARB     glGetProgramEnvParameterdvARB;
pfglGetProgramEnvParameterfvARB     glGetProgramEnvParameterfvARB;
pfglGetProgramLocalParameterdvARB   glGetProgramLocalParameterdvARB;
pfglGetProgramLocalParameterfvARB   glGetProgramLocalParameterfvARB;

typedef void function(GLenum, GLenum, GLint*) pfglGetProgramivARB;
typedef void function(GLenum, GLenum, GLvoid*) pfglGetProgramStringARB;
typedef void function(GLuint, GLenum, GLdouble*) pfglGetVertexAttribdvARB;
typedef void function(GLuint, GLenum, GLfloat*) pfglGetVertexAttribfvARB;
typedef void function(GLuint, GLenum, GLint*) pfglGetVertexAttribivARB;
typedef void function(GLuint, GLenum, GLvoid*) pfglGetVertexAttribPointervARB;
typedef GLboolean function(GLuint) pfglIsProgramARB;
pfglGetProgramivARB                 glGetProgramivARB;
pfglGetProgramStringARB             glGetProgramStringARB;
pfglGetVertexAttribdvARB            glGetVertexAttribdvARB;
pfglGetVertexAttribfvARB            glGetVertexAttribfvARB;
pfglGetVertexAttribivARB            glGetVertexAttribivARB;
pfglGetVertexAttribPointervARB      glGetVertexAttribPointervARB;
pfglIsProgramARB                    glIsProgramARB;